
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<html>
	<head>
		<%@ include file="/commons/meta.jsp"%>
	</head>  

	<body>
		<table width="100%" height="100%" border="0" cellpadding="0"
			cellspacing="0">

			<tr>
				<td align="center" valign="top">
					<div id="position">
						当前位置：工单系统 - 字段管理 -
						<s:if test="id == null">添加字段</s:if>
						<s:else>修改字段</s:else>
					</div>
					<form name="form1" method="post"
						action="${ctx}/workorder/fieldAttribute!save.action">
						<input type="hidden" name="id" value="${id}">
						<input name="fieldId" type=hidden value="${fieldId}">
						<table width="95%" border="0" cellspacing="2" cellpadding="2">
							<font color="red">${msg}</font>
							<tr>
								<td class="name">
									<s:if test="id == null">添加字段</s:if>
									<s:else>修改字段</s:else>
								</td>
							</tr>
						</table>
						<table width="95%" border="0" cellspacing="1" cellpadding="2"
							bgcolor="#CEEFFF">
							<tr>
								<td width="100" bgcolor="#FFFFFF">
									<div class="item">
										名称:
									</div>
								</td>
								<td bgcolor="#FFFFFF">
									<input name="name" type="text" size="20" value=${name}>
									<font color="red"> *</font>
								</td>
							</tr>
							<tr>
								<td width="100" bgcolor="#FFFFFF">
									<div class="item">
										是否必填:
									</div>
								</td>
								<td bgcolor="#FFFFFF">
									<select name="isMustInput">
										<option
											value="${IS_MUST_INPUT_YES}" <s:if test="isMustInput==IS_MUST_INPUT_YES">selected</s:if>>
											必填
										</option>
										<option
											value="${IS_MUST_INPUT_NO}" <s:if test="isMustInput==IS_MUST_INPUT_NO">selected</s:if>>
											选填
										</option>
									</select>
									<font color="red"> *</font>
								</td>
							</tr>
							<tr>
								<td width="100" bgcolor="#FFFFFF">
									<div class="item">
										类型:
									</div>
								</td>
								<td bgcolor="#FFFFFF">
									<select name="type">
										<option
											value="${FIELD_TYPE_TEXT}" <s:if test="type==FIELD_TYPE_TEXT">selected</s:if>>
											文本
										</option>
										<option
											value="${FIELD_TYPE_RADIO}" <s:if test="type==FIELD_TYPE_RADIO">selected</s:if>>
											单选
										</option>
										<option
											value="${FIELD_TYPE_CHECKBOX}" <s:if test="type==FIELD_TYPE_CHECKBOX">selected</s:if>>
											多选
										</option>
									</select>
									<font color="red"> *</font>
								</td>
							</tr> 
							<tr>
								<td width="100" bgcolor="#FFFFFF">
									<div class="item">
										备注:
									</div>
								</td>
								<td bgcolor="#FFFFFF">
									<input name="memo" type="text" size="100" value=${memo}>
								</td>
							</tr>
						</table>
						<table width="95%" border="0" cellspacing="2" cellpadding="2"
							bgcolor="#CEEFFF">
							<tr>
								<td align="left">
									<input type="button" name="Submit2" onClick="add()" value="提交">
									<input type="reset" name="Submit3" value="重置">
									<input type="button" name="Submit1" onClick="returnBack()"
										value="返回">
								</td>
							</tr>
						</table>
					</form>
				</td>
			</tr>
		</table>
		<script>
		function add(){
			${'form1'}.submit();
			/*
			${'form1'}.loginName.value=Trim(${'form1'}.loginName.value);
			
			if(isEmpty(${'form1'}.loginName.value))
			{
				alert("请填写用户名");
				return false;
			}
			
			//验证中文正则表达式
			var reg = /[\u4e00-\u9fa5]/;
			var loginNameObj = ${'form1'}.loginName.value;
			if(reg.test(loginNameObj))   
			{   
			  alert("用户名不允许包含中文!");  
			  return  false;   
		    }   
			
			if(fucCheckLength(Trim(form1.loginName.value))>20)
			{
				alert("用户名请不要多于20个字符");
				return false;
			}
			${'form1'}.password.value=Trim(${'form1'}.password.value);
			if(isEmpty(${'form1'}.password.value))
			{
				alert("请填写密码");
				return false;
			}
			
			var passwordObj = ${'form1'}.password.value;
			if(reg.test(passwordObj))   
			{   
			  alert("密码不允许包含中文!");  
			  return  false;   
		    }  
			
			if(fucCheckLength(Trim(form1.password.value))>20)
			{
				alert("密码请不要多于20个字符");
				return false;
			}
			
			${'form1'}.name.value=Trim(${'form1'}.name.value);
			if(isEmpty(${'form1'}.name.value))
			{
				alert("请填写姓名");
				return false;
			}
			if(fucCheckLength(Trim(form1.name.value))>20)
			{
				alert("姓名请不要多于20个字符");
				return false;
			}
			${'form1'}.email.value=Trim(${'form1'}.email.value);
			if(fucCheckLength(Trim(form1.email.value))>40)
			{
				alert("邮箱请不要多于40个字符");
				return false;
			}
			${'form1'}.tel.value=Trim(${'form1'}.tel.value);
			if(fucCheckLength(Trim(form1.tel.value))>20)
			{
				alert("电话请不要多于20个字符");
				return false;
			}
			${'form1'}.department.value=Trim(${'form1'}.department.value);
			if(fucCheckLength(Trim(form1.department.value))>20)
			{
				alert("所属部门请不要多于20个字符");
				return false;
			}
			*/
			
		}
		
		function returnBack(){
			document.location="${ctx}/workorder/fieldAttribute.action";
		}
		</script>
	</body>
</html>
